﻿<%--
   Copyright 2012 University of Southampton

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
--%>

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileGraphXY.aspx.cs" Inherits="uk.ac.soton.ses.layouts.FileGraphXY" %>

<%@ Register TagPrefix="asp" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.WebControls" %>
<%@ Register TagPrefix="hdc" Namespace="uk.ac.soton.ses.WebControls" Assembly="HDCWebControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be2a37f6f7c4bcce" %>
<%@ Register TagPrefix="hdc" TagName="ExperimentMultipleSelection" Src="/_ControlTemplates/uk.ac.soton.ses/HDCUserControls/ExperimentMultipleSelection.ascx" %>

<html>

<head>
<title>File Graph</title>
<style type="text/css">
    
    /*#ReportTable{font-family:Sans-Serif;font-size:10pt;}*/
    body {font-family:Sans-Serif;font-size:10pt;}
    #ReportTable td,#ReportTable th {padding:0px 10px 0px 10px;text-align:left;}
    #ReportTable th {font-weight:bold;}
    #ReportTable td { border: 1px solid grey;}

    @media screen
    {
        body {font-size:8pt;}
        .ReportDiv {float:left;}
        #ReportConfigurationDiv {width:430px;}
        #ReportOutputDiv {width:700px;}

        #DatasetSelectionDiv{background-color:#bbddff;}
        #ParameterSelectionDiv{background-color:#aaddaa;}
        table.FieldSelection {font-size:8pt;}
        #ReportTableDiv {height:460px;overflow:auto;}

        .OptionLabel{float:left;width:12em;clear:left;}
        .OptionBox{float:left;width:3em;}
        .OptionDiv{background-color:#aaffaa;}
        .InfoDiv{background-color:#dddddd;}
        .ExcludedItems{color:Red;}

        .SelectionDiv {overflow:auto;font-family:Helvetica, Arial, sans-serif;font-size:7pt;}
        .SelectionDiv input {font-family:inherit;font-size:inherit;}
        .ParameterSeriesOneColumnCell{float:left;width:45px;}
        .ParameterSeriesTwoColumnCell{float:left;width:90px;word-wrap:break-word;}
        .ParameterSeriesThreeColumnCell{float:left;width:135px;word-wrap:break-word;}
        .ParameterSeriesFourColumnCell{float:left;width:180px;word-wrap:break-word;}
        .ParameterSeriesFiveColumnCell{float:left;width:225px;word-wrap:break-word;}
        .ParameterSeriesSixColumnCell{float:left;width:270px;word-wrap:break-word;}
        .ParameterSeriesTextBox{width:42px;}
        
        .ui-autocomplete {max-height: 100px; overflow: auto;}
        .ui-menu-item {font-family:Helvetica, Arial, sans-serif;font-size:8pt;}
    }
    
    @media print
    {
        .NonPrintDiv{display:none;}
        #ReportTable{font-family:Serif}
    }
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js" type="text/javascript"></script>
<script src="/_layouts/HDC/Scripts/HighCharts-3.0.2/js/highcharts.js" type="text/javascript"></script>
<link rel="Stylesheet" href="//code.jquery.com/ui/1.8.24/themes/base/jquery-ui.css" type="text/css" />
</head>

<body>
<form ID="form" runat="server">
    <div id="ReportConfigurationDiv" class="ReportDiv NonPrintDiv">

        <%--Dataset selection--%>
        <hdc:ExperimentMultipleSelection ID="ctl_ExperimentMultipleSelection" runat="server"/>

        <%--File selection--%>
        <div id="FileSelectionDiv">
            <div style="height:35px;float:left;clear:left">
                <div style="float:left;clear:left">
                    <b>Data file selection:</b> 
                    <asp:LinkButton ID="btn_Refresh1" runat="server" Text="Refresh" />
                </div>
                <div class="SelectionDiv" style="float:left;clear:left">
                    <div class="ParameterSeriesOneColumnCell"><b>Start</b></div>
                    <div class="ParameterSeriesOneColumnCell"><b>Rows</b></div>
                    <div class="ParameterSeriesOneColumnCell"><b>Delim</b></div>
                    <div class="ParameterSeriesOneColumnCell"><b>Header</b></div>
                    <div class="ParameterSeriesFourColumnCell"><b>File</b></div>
                </div>
            </div>
            <div class="SelectionDiv" style="height:115px;width:100%;float:left;clear:left;">
                <asp:ListView ID="ListView_DataFiles" runat="server" DataKeyNames="DataFileID">
                    <LayoutTemplate>
                        <div runat="server">
                            <div runat="server" id="itemPlaceholder"></div>
                        </div>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <div runat="server" style="float:left;clear:left">
                            <div runat="server" class="ParameterSeriesOneColumnCell"><asp:TextBox ID="txt_StartRow" runat="server" text='<%# Eval("StartRow") %>' CssClass="ParameterSeriesTextBox" OnTextChanged="txt_DataFileOptions_TextChanged" /></div>
                            <div runat="server" class="ParameterSeriesOneColumnCell"><asp:TextBox ID="txt_MaxRows" runat="server" text='<%# Eval("MaxRows") %>' CssClass="ParameterSeriesTextBox" OnTextChanged="txt_DataFileOptions_TextChanged" /></div>
                            <div runat="server" class="ParameterSeriesOneColumnCell"><asp:TextBox ID="txt_Delimiter" runat="server" CssClass="ParameterSeriesTextBox" OnTextChanged="txt_DataFileOptions_TextChanged" /></div>
                            <div runat="server" class="ParameterSeriesOneColumnCell"><asp:TextBox ID="txt_HeaderRow" runat="server" text='<%# Eval("HeaderRow") %>' CssClass="ParameterSeriesTextBox" OnTextChanged="txt_DataFileOptions_TextChanged" /></div>
                            <div runat="server" class="ParameterSeriesFourColumnCell"><asp:Label ID="lbl_DataFileName" runat="server" text='<%# Eval("UniqueName") %>' /></div>
                        </div>
                    </ItemTemplate>
                </asp:ListView>
            </div>
            <div style="clear:both"></div>
        </div>

        <%--Parameter Selection --%>
        <div id="ParameterSelectionDiv">
            <div style="height:35px;float:left;clear:left;">
                <div style="float:left;clear:left">
                    <b>Field selection:</b> 
                    <asp:LinkButton ID="btn_Refresh2" runat="server" Text="Refresh" />
                </div>
                <div class="SelectionDiv" style="float:left;clear:left">
                    <div class="ParameterSeriesOneColumnCell"><b>X Series</b></div>
                    <div class="ParameterSeriesOneColumnCell"><b>Y Series</b></div>
                    <div class="ParameterSeriesSixColumnCell"><b>Field</b></div>
                </div>
            </div>
            <div class="SelectionDiv" style="height:110px;width:100%;float:left;clear:left;">
                <asp:ListView ID="ListView_Parameters" runat="server" DataKeyNames="DataItemID,FieldNo">
                    <LayoutTemplate>
                        <div runat="server">
                            <div runat="server" id="itemPlaceholder"></div>
                        </div>
                    </LayoutTemplate>
                    <ItemTemplate>
                            <div runat="server" style="float:left;clear:left;width:100%">
                                <div runat="server" class="ParameterSeriesOneColumnCell"><asp:TextBox ID="txt_XParam" runat="server" text='<%# Eval("XSeries") %>' OnTextChanged="txt_DataFileOptions_TextChanged" CssClass="ParameterSeriesTextBox" /></div>
                                <div runat="server" class="ParameterSeriesOneColumnCell"><asp:TextBox ID="txt_YParam" runat="server" text='<%# Eval("YSeries") %>' OnTextChanged="txt_DataFileOptions_TextChanged" CssClass="ParameterSeriesTextBox" /></div>
                                <div runat="server" class="ParameterSeriesSixColumnCell"><asp:Label ID="lbl_FieldName" runat="server" text='<%# Eval("DataItemName") %>' /></div>
                            </div>
                    </ItemTemplate>
                </asp:ListView>
            </div>
            <div style="clear:both"></div>
        </div>
    </div>
    <div id="ReportOutputDiv" class="ReportDiv">
        <div id="ReportTableDiv">
            <div id="graphcontainer"></div>
            <asp:PlaceHolder ID="PlaceHolder_Messages" runat="server" />
        </div>
        <div style="float:left;width:100%">
            <asp:Label runat="server" AssociatedControlID="txt_XAxisTitle" Text="X Title:" /><asp:TextBox ID="txt_XAxisTitle" runat="server" OnTextChanged="txt_ChartInfoChanged"/>
            <asp:Label runat="server" AssociatedControlID="txt_YAxisTitle" Text="Y Title:"/><asp:TextBox ID="txt_YAxisTitle" runat="server" OnTextChanged="txt_ChartInfoChanged" />
            <asp:Label runat="server" AssociatedControlID="txt_ChartTitle" Text="Chart Title:"/><asp:TextBox ID="txt_ChartTitle" runat="server" OnTextChanged="txt_ChartInfoChanged" />
            <asp:LinkButton runat="server" Text="Refresh" />
        </div>
        <asp:Panel id="ReportButtons" class="NonPrintDiv" runat="server" style="float:left;width:100%">
            <div style="float:left">
                <%--Report save buttons go here--%>
            </div>
            <div style="float:right">
                <%--Graph configuration buttons go here--%>
            </div>
        </asp:Panel>
    </div>
</form>
</body>

</html>